/*
   
   Copyright 2011 DAVID ALBERTSON, FRANCIS DESLAURIERS, ANTHONY BUFFET  &  DUINOP.COM

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   
*/

package com.gpsmap;

import java.util.Locale;

import android.location.Location;
import android.os.Build;
import android.os.SystemClock;

public class UserStatus {

	private Location position;
	private String uniqueID;
	private String message;
	private String model;
	private String manufacturer;
	private long timeSinceLastBoot;
	private String country;
	private String language;
	private int numOsVersion;
	
	UserStatus(Location inPosition, String inUniqueID)
	{
		Locale locale = Locale.getDefault() ;
		
		position = inPosition;
		uniqueID = inUniqueID;
		message = "Phone";	
		model = Build.MODEL;
		manufacturer = Build.MANUFACTURER;
		timeSinceLastBoot = SystemClock.elapsedRealtime();
		country = locale.getDisplayCountry();
		language = locale.getDisplayLanguage();
		numOsVersion = Build.VERSION.SDK_INT;


	}
	
	public float getLatitude()
	{
		return (float) position.getLatitude();
	}
	
	public float getlongitude()
	{
		return (float)position.getLongitude();
	}
	
	public String getUniqueID() 
	{
		return uniqueID;
	}
		
	public String getMessage()
	{
		return message;
	}
	
	public void SetPosition(Location inPosition)
	{
		position = inPosition;
		
	}
	
	public void setMessage(String inMessage)
	{
		
		message = inMessage;
		
	}

	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}

	public String getManufacturer() {
		return manufacturer;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getModel() {
		return model;
	}

	public void setTimeSinceLastBoot(long timeSinceLastBoot) {
		this.timeSinceLastBoot = timeSinceLastBoot;
	}

	public long getTimeSinceLastBootInSeconds() {
		return (int) timeSinceLastBoot/1000;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getCountry() {
		return country;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getLanguage() {
		return language;
	}

	public double getOsVersion()
	{
		switch(numOsVersion)
		{
			case Build.VERSION_CODES.BASE:
			{
				return 1.0;
			}
			case Build.VERSION_CODES.BASE_1_1:
			{
				return 1.1;
			}
			case Build.VERSION_CODES.CUPCAKE:
			{
				return 1.5;
			}
			case Build.VERSION_CODES.DONUT:
			{
				return 1.6;
			}
			case Build.VERSION_CODES.ECLAIR:
			{
				return 2.0;
			}
			case Build.VERSION_CODES.ECLAIR_0_1:
			{
				return 2.0;
			}
			case Build.VERSION_CODES.ECLAIR_MR1:
			{
				return 2.1;
			}
			case Build.VERSION_CODES.FROYO:
			{
				return 2.2;
			}
			/*
			case Build.VERSION_CODES.GINGERBREAD:
			{
				return 2.3;
			}
			case Build.VERSION_CODES.GINGERBREAD_MR1:
			{
				return 2.3;
			}
			case Build.VERSION_CODES.HONEYCOMB:
			{
				return 3.0;
			}
			case Build.VERSION_CODES.HONEYCOMB_MR1:
			{
				return 3.1;
			}*/
			default:
				return 8.0;
		}
	}




}
